/*

*** This do file creates the replication results for 

Globalization and Women's Empowerment: An Analysis of Spatial Dependence via Trade and Foreign Direct Investment (with Indra de Soysa), World Development, 39 (7), 2011, pp. 1065-1075 

Eric Neumayer (LSE)																			

Please report any errors to e.neumayer@lse.ac.uk

*/

use "Article for World Development (womens rights).dta", replace

version 11
tsset countryid year

* Tables 2 and 3
xi: quietly ologit  wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: su wecon lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst if e(sample)
xi: corr wecon lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst wosoc l.wosocfdiinstockslrowst l.wosoctradeslrowst  if e(sample)
xi: quietly ologit  wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: su wosoc l.wosocfdiinstockslrowst l.wosoctradeslrowst if e(sample)


*** Table 4: Women's economic rights
** All countries
xi: ologit  wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: ologit  wecon l.wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wecon  l.wecon lngdpconstpc  polity2 trade   fdiinstocktogdp   l.weconfdiinstockslrowst l.wecontradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wecon l.weconfdiinstockslrowst l.wecontradeslrowst, lag (2 8))
xi: xtdpd  L(0/3).(wecon)  L(1/2).(weconfdiinstockslrowst wecontradeslrowst) lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year, div(lngdpconstpc  polity2 trade  fdiinstocktogdp    i.year) dgmmiv(wecon, lag(3 7)) dgmmiv( weconfdiinstockslrowst wecontradeslrowst, lag(3 6)) lgmmiv(wecon weconfdiinstockslrowst wecontradeslrowst) vce(robust) hascons artests(2)
estat abond

** Developing countries only
preserve
keep if inc_highoecd==0

xi: ologit  wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: ologit  wecon l.wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wecon  l.wecon lngdpconstpc  polity2 trade   fdiinstocktogdp   l.weconfdiinstockslrowst l.wecontradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wecon l.weconfdiinstockslrowst l.wecontradeslrowst, lag (2 8))
xi: xtdpd  L(0/3).(wecon)  L(1/2).(weconfdiinstockslrowst wecontradeslrowst) lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year, div(lngdpconstpc  polity2 trade  fdiinstocktogdp    i.year) dgmmiv(wecon, lag(3 7)) dgmmiv( weconfdiinstockslrowst wecontradeslrowst, lag(3 6)) lgmmiv(wecon weconfdiinstockslrowst wecontradeslrowst) vce(robust) hascons artests(2)
estat abond

restore

*** Table 5: Women's social rights
** All countries
xi: ologit  wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: ologit  wosoc l.wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wosoc  l.wosoc lngdpconstpc  polity2 trade   fdiinstocktogdp   l.wosocfdiinstockslrowst l.wosoctradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wosoc l.wosocfdiinstockslrowst l.wosoctradeslrowst, lag (2 8))

** Developing countries only
preserve
keep if inc_highoecd==0

xi: ologit  wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: ologit  wosoc l.wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wosoc  l.wosoc lngdpconstpc  polity2 trade   fdiinstocktogdp   l.wosocfdiinstockslrowst l.wosoctradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wosoc l.wosocfdiinstockslrowst l.wosoctradeslrowst, lag (2 8))

restore

*** Table 6: Women's economic and social rights in low- and middle-income countries
** Economic rights
* Low-income countries only
preserve
keep if inc_low==1

xi: ologit  wecon l.wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wecon  l.wecon lngdpconstpc  polity2 trade   fdiinstocktogdp   l.weconfdiinstockslrowst l.wecontradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wecon l.weconfdiinstockslrowst l.wecontradeslrowst, lag (2 8))

restore

* Middle-income countries only
preserve
keep if inc_middle==1

xi: ologit  wecon l.wecon  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.weconfdiinstockslrowst l.wecontradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wecon  l.wecon lngdpconstpc  polity2 trade   fdiinstocktogdp   l.weconfdiinstockslrowst l.wecontradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wecon l.weconfdiinstockslrowst l.wecontradeslrowst, lag (2 8))
xi: xtdpd  L(0/3).(wecon)  L(1/2).(weconfdiinstockslrowst wecontradeslrowst) lngdpconstpc  polity2 trade   fdiinstocktogdp    i.year, div(lngdpconstpc  polity2 trade  fdiinstocktogdp    i.year) dgmmiv(wecon, lag(3 7)) dgmmiv( weconfdiinstockslrowst wecontradeslrowst, lag(3 6)) lgmmiv(wecon weconfdiinstockslrowst wecontradeslrowst) vce(robust) hascons artests(2)

restore

** Social rights
* Low-income countries only
preserve
keep if inc_low==1

xi: ologit  wosoc l.wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wosoc  l.wosoc lngdpconstpc  polity2 trade   fdiinstocktogdp   l.wosocfdiinstockslrowst l.wosoctradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wosoc l.wosocfdiinstockslrowst l.wosoctradeslrowst, lag (2 8))

restore

* Middle-income countries only
preserve
keep if inc_middle==1

xi: ologit  wosoc l.wosoc  lngdpconstpc  polity2 trade   fdiinstocktogdp    l.wosocfdiinstockslrowst l.wosoctradeslrowst i.year reg_*, robust cluster(country)
xi: xtabond2  wosoc  l.wosoc lngdpconstpc  polity2 trade   fdiinstocktogdp   l.wosocfdiinstockslrowst l.wosoctradeslrowst  i.year, robust iv(lngdpconstpc  polity2 trade   fdiinstocktogdp     i.year) gmm(l.wosoc l.wosocfdiinstockslrowst l.wosoctradeslrowst, lag (2 8))

restore
